<?php
/**
 * @version		2.0.1 | $Id: tableplayer.php 114 2009-09-02 12:43:54Z mwi.nor $
 */

// no direct access
defined( '_JEXEC' ) or die();
	$cparams =& JComponentHelper::getParams('com_matchdart');
?>
<div class="contentdescription<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>" align="center">
<?php echo JText::_( 'MD_TABLE_EVENT_SCHEDULE' ); ?>
</div>

<table class="contentpane<?php echo $cparams->get('pageclass_sfx'); ?>">
<?php
    $s_items =& $this->s_items;
    $odd = 0; 
    $tempdate = '';

    foreach($s_items as $s_item) : ?>
    <?php if ($s_item->MatchDate != $tempdate) :?>
	<tr class="sectiontableheader<?php echo $this->escape($cparams->get('pageclass_sfx')); ?>">
    	<td align="center"><?php echo $s_item->MatchDate; ?></td>
    	<td></td>
    	<td align="center"><?php echo $s_item->VenueName; ?></td>
	</tr>
	<?php endif;?>    
		<tr class="sectiontableentry<?php echo $odd+1 . $this->escape($cparams->get('pageclass_sfx')); ?>">
	    	<td align="center" <?php echo ($s_item->MatchResult == 1) ? 'class="highlight'.$this->escape($cparams->get('pageclass_sfx')).'"' : ''; ?>><?php echo $s_item->HomePlayerName; ?></td>
	    	<td align="center"><?php echo $s_item->HomeLegs.' - '.$s_item->AwayLegs; ?></td>
	    	<td align="center" <?php echo ($s_item->MatchResult == 2) ? 'class="highlight'.$this->escape($cparams->get('pageclass_sfx')).'"' : ''; ?>><?php echo $s_item->AwayPlayerName; ?></td>
    	</tr>
    	
	<?php 
	$odd = 1 - $odd;
	$tempdate = $s_item->MatchDate;
	endforeach; ?>
</table>
